<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        body{
            width: 100%;
            height: 100%;
            background-color: black;
        }
        .person{
            width: 180px;
            height: 200px;
            /* background-color: greenyellow; */
            margin: 50px;
            position: relative;
            animation: run 4s infinite ease-in; 
        }
        .head{
            width: 30px;
            height: 30px;
            border: 5px solid white;
            border-radius: 50%;
            position: absolute;
            top: 10px;
            left: 70px;
            animation: head 2s infinite alternate; 
        }
        .torso{
            width: 0;
            height: 60px;
            border-left: 5px solid white;
            position: absolute;
            top: 50px;
            left: 80px;
        }
        .onearm{
            width: 40px;
            height: 45px;
            border-left: 5px solid white;
            border-bottom: 5px solid white;
            position: absolute;
            top: 50px;
            left: 80px;
            transform-origin: 0% 0% 0px;
            transform: rotate3d(0,0,1,80deg);
            animation: arm 2s infinite ease-in-out; 
        }
        .towarm{
            width: 40px;
            height: 45px;
            border-left: 5px solid white;
            border-bottom: 5px solid white;
            position: absolute;
            top: 50px;
            left: 80px;
            transform-origin: 0% 0% 0px;
            transform: rotate3d(0,0,1,-80deg);
            animation: arm 2s 1s infinite ease-in-out;
        }
        .oneleg{
            width: 60px;
            height: 60px;
            border-right:5px solid white;
            border-top:5px solid white;
            position: absolute;
            transform-origin: 0% 0% 0px;
            top: 110px;
            left: 80px;
            transform: rotate3d(0,0,1,100deg);
            animation: leg 2s infinite ease-in-out;
        }
        .towleg{
            width: 60px;
            height: 60px;
            border-right:5px solid white;
            border-top:5px solid white;
            position: absolute;
            transform-origin: 0% 0% 0px;
            top: 110px;
            left: 80px;
            transform: rotate3d(0,0,1,10deg);
            animation: leg 2s 1s infinite ease-in-out;
        }
        /* 头部动画 */
        @keyframes head {
            0%{
                transform: rotate3d(0,0,1,5deg);
            }
            25%{
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            50%{
                transform: rotate3d(0,0,1,5deg);
            }
            75%{
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            100%{
                transform: rotate3d(0,0,1,20deg) skew(-15deg,0deg);
            }
            
        }
        /* 胳膊摆动 */
        @keyframes arm {
            0%{
                transform: rotate3d(0,0,1,80deg);
            }
            50%{
                transform: rotate3d(0,0,1,-70deg);
            }
            100%{
                transform: rotate3d(0,0,1,80deg);
            }
        }
        /* 腿摆动 */
        @keyframes leg {
            0%{
                transform: rotate3d(0,0,1,-5deg);
            }
            50%{
                transform: rotate3d(0,0,1,150deg);
            }
            100%{
                transform: rotate3d(0,0,1,-5deg);
            }
        }
        /* 让火柴人向前跑 */
        @keyframes run {
            0%{
                transform: translate(-200px,0px);
            }
            100%{
                transform: translate(1800px,0px);
            }
        }
    </style>
</head>
<body>
    <div class="person">
            <div class="head"></div>
            <div class="onearm"></div>
            <div class="towarm"></div>
            <div class="torso"></div>
            <div class="oneleg"></div>
            <div class="towleg"></div>
    </div>
</body>
</html>